#include "MetaProgress.hh"

MetaProgress::MetaProgress()
    :bonusMaxHP(0), startingGold(0), startingAP(0){}
    
void MetaProgress::gainProgress(bool wonBoss, bool defeatedByMonster) {
    if (wonBoss) {
        bonusMaxHP += 10;
        startingGold += 50;
        startingAP += 2;
        std::cout << "Victory Bonus: +10 Max HP, +50 Gold, +2 Max AP!\n";
    } else if (defeatedByMonster) {
        bonusMaxHP += 5;
        startingGold += 20;
        startingAP += 1;
        std::cout << "Failure Bonus: +5 Max HP, +20 Gold, +1 Max AP.\n";
    } else {
        startingAP += 2;
        std::cout << "Exploration Bonus: +2 Max AP.\n";
    }
}

void MetaProgress::displayProgress() const {
    std::cout << "=== Persistent Progress ===\n";
    std::cout << "Max HP Bonus: +" << bonusMaxHP << "\n";
    std::cout << "Starting Gold: +" << startingGold << "\n";
    std::cout << "Starting AP: +" << startingAP << "\n";
}

Player MetaProgress::createPlayer() const{
    
    return Player("Hero",
                  baseHP + bonusMaxHP,
                  baseHP + bonusMaxHP,
                  baseATK,
                  baseDEF,
                  baseAP + startingAP,
                  baseGold + startingGold);
}

unsigned MetaProgress::getMaxAp() const{
    return baseAP + startingAP;
}